package com.itwxz.system.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itwxz.system.domain.dto.SelectOrderDto;
import com.itwxz.system.domain.po.WxzOrder;
import com.itwxz.system.domain.po.YiLaoForm;
import com.itwxz.system.domain.vo.OperateOrderVo;
import com.itwxz.system.domain.vo.SearchOrderVo;
import com.itwxz.system.domain.vo.StaffRankingVo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 维修站订单Mapper接口
 *
 * @author gastronome
 * @date 2025-04-05
 */
@Mapper
public interface WxzOrderMapper extends BaseMapper<WxzOrder> {

    /**
     * 查询维修站订单列表
     *
     * @param wxzOrder 维修站订单
     * @return 维修站订单集合
     */
    List<SelectOrderDto> selectWxzOrderList(SelectOrderDto wxzOrder);

    List<YiLaoForm> getOrderCountByCompletionTime(SelectOrderDto wxzOrder);

    List<OperateOrderVo> selectInProgressOrder();

    List<OperateOrderVo> selectPendingOrder();

    @MapKey("name")  // 指定 Map 的键为 name 字段
    List<Map<String, Object>> countOrdersByBuilding();

    List<Map<String, Object>> selectRecent7DaysOrderCount();

    List<SearchOrderVo> searchOrderWithStaff(@Param("keyword") String keyword);

    @MapKey("nickName")
    List<StaffRankingVo> getStaffRankingSimple();

    List<StaffRankingVo> getStaffWeeklyRanking();

    List<SearchOrderVo> selectOrderStatus23();

    // 清空表数据并重置自增主键
	void truncateTable();
}
